import Vue from 'vue';
import App from './App.vue';
import router from './router';
import store from './store';
import api from './api/index';
// import http from '../http';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios';
import { getStorage, setStorage, removeStorage } from './assets/js/storage.js';

import * as echarts from 'echarts';
import 'default-passive-events';

// import * as echarts from 'echarts';

// 打印插件
import Print from 'vue-print-nb';
Vue.use(Print);

//引入并全局使用elementUI
Vue.use(ElementUI);
Vue.prototype.$axios = axios;
Vue.prototype.$echarts = echarts;
// Vue.use(Element, { size: 'small', zIndex: 3000 });

// Vue.prototype.$http = http;
Vue.prototype.$api = api.api;
Vue.prototype.$getStorage = getStorage;
Vue.prototype.$setStorage = setStorage;
Vue.prototype.$removeStorage = removeStorage;

Vue.config.productionTip = false;
// router.beforeEach((to, from, next) => {
//   if (to.matched.some(predicate => predicate.meta.isLogin)) {
//     if (store.state.users) {
//       next();
//     } else {
//       next('/');
//     }
//   } else {
//     next();
//   }
// });

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app');
